﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProtocolBuilder.Model.Field
{
    public abstract class SimpleField : AbsField
    {
        public abstract string SerializeTemplete { get; }
        public abstract string DeserializeTemplete { get; }

        public override sealed string GenerateSerializeCode()
        {
            return string.Format("{0}{1}//{2}", this.GenerateWhiteSpace(), this.SerializeTemplete, this.Description);
        }

        public override sealed string GenerateDeserializeCode()
        {
            return string.Format("{0}{1}//{2}", this.GenerateWhiteSpace(), this.DeserializeTemplete, this.Description);
        }

        public override sealed bool CanHasChildren
        {
            get
            {
                return false;
            }
        }
    }
}
